(0) Obligation:

Clauses:

hbal_tree(zero, nil).
hbal_tree(s(zero), t(x, nil, nil)).
hbal_tree(s(s(X)), t(x, L, R)) :- ','(distr(s(X), X, DL, DR), ','(hbal_tree(DL, L), hbal_tree(DR, R))).
distr(D1, X1, D1, D1).
distr(D1, D2, D1, D2).
distr(D1, D2, D2, D1).

Query: hbal_tree(g,a)

(1) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
hbal_tree_in: (b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

hbal_tree_in_ga(zero, nil) → hbal_tree_out_ga(zero, nil)
hbal_tree_in_ga(s(zero), t(x, nil, nil)) → hbal_tree_out_ga(s(zero), t(x, nil, nil))
hbal_tree_in_ga(s(s(X)), t(x, L, R)) → U1_ga(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
distr_in_ggaa(D1, X1, D1, D1) → distr_out_ggaa(D1, X1, D1, D1)
distr_in_ggaa(D1, D2, D1, D2) → distr_out_ggaa(D1, D2, D1, D2)
distr_in_ggaa(D1, D2, D2, D1) → distr_out_ggaa(D1, D2, D2, D1)
U1_ga(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_ga(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U2_ga(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_ga(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U3_ga(X, L, R, DL, DR, hbal_tree_out_ga(DR, R)) → hbal_tree_out_ga(s(s(X)), t(x, L, R))

The argument filtering Pi contains the following mapping:
hbal_tree_in_ga(x1, x2)  =  hbal_tree_in_ga(x1)
zero  =  zero
hbal_tree_out_ga(x1, x2)  =  hbal_tree_out_ga(x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
distr_in_ggaa(x1, x2, x3, x4)  =  distr_in_ggaa(x1, x2)
distr_out_ggaa(x1, x2, x3, x4)  =  distr_out_ggaa(x3, x4)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x2, x6)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

hbal_tree_in_ga(zero, nil) → hbal_tree_out_ga(zero, nil)
hbal_tree_in_ga(s(zero), t(x, nil, nil)) → hbal_tree_out_ga(s(zero), t(x, nil, nil))
hbal_tree_in_ga(s(s(X)), t(x, L, R)) → U1_ga(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
distr_in_ggaa(D1, X1, D1, D1) → distr_out_ggaa(D1, X1, D1, D1)
distr_in_ggaa(D1, D2, D1, D2) → distr_out_ggaa(D1, D2, D1, D2)
distr_in_ggaa(D1, D2, D2, D1) → distr_out_ggaa(D1, D2, D2, D1)
U1_ga(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_ga(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U2_ga(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_ga(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U3_ga(X, L, R, DL, DR, hbal_tree_out_ga(DR, R)) → hbal_tree_out_ga(s(s(X)), t(x, L, R))

The argument filtering Pi contains the following mapping:
hbal_tree_in_ga(x1, x2)  =  hbal_tree_in_ga(x1)
zero  =  zero
hbal_tree_out_ga(x1, x2)  =  hbal_tree_out_ga(x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
distr_in_ggaa(x1, x2, x3, x4)  =  distr_in_ggaa(x1, x2)
distr_out_ggaa(x1, x2, x3, x4)  =  distr_out_ggaa(x3, x4)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x2, x6)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

HBAL_TREE_IN_GA(s(s(X)), t(x, L, R)) → U1_GA(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
HBAL_TREE_IN_GA(s(s(X)), t(x, L, R)) → DISTR_IN_GGAA(s(X), X, DL, DR)
U1_GA(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_GA(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U1_GA(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → HBAL_TREE_IN_GA(DL, L)
U2_GA(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_GA(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U2_GA(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → HBAL_TREE_IN_GA(DR, R)

The TRS R consists of the following rules:

hbal_tree_in_ga(zero, nil) → hbal_tree_out_ga(zero, nil)
hbal_tree_in_ga(s(zero), t(x, nil, nil)) → hbal_tree_out_ga(s(zero), t(x, nil, nil))
hbal_tree_in_ga(s(s(X)), t(x, L, R)) → U1_ga(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
distr_in_ggaa(D1, X1, D1, D1) → distr_out_ggaa(D1, X1, D1, D1)
distr_in_ggaa(D1, D2, D1, D2) → distr_out_ggaa(D1, D2, D1, D2)
distr_in_ggaa(D1, D2, D2, D1) → distr_out_ggaa(D1, D2, D2, D1)
U1_ga(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_ga(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U2_ga(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_ga(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U3_ga(X, L, R, DL, DR, hbal_tree_out_ga(DR, R)) → hbal_tree_out_ga(s(s(X)), t(x, L, R))

The argument filtering Pi contains the following mapping:
hbal_tree_in_ga(x1, x2)  =  hbal_tree_in_ga(x1)
zero  =  zero
hbal_tree_out_ga(x1, x2)  =  hbal_tree_out_ga(x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
distr_in_ggaa(x1, x2, x3, x4)  =  distr_in_ggaa(x1, x2)
distr_out_ggaa(x1, x2, x3, x4)  =  distr_out_ggaa(x3, x4)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x2, x6)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x
HBAL_TREE_IN_GA(x1, x2)  =  HBAL_TREE_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
DISTR_IN_GGAA(x1, x2, x3, x4)  =  DISTR_IN_GGAA(x1, x2)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x2, x6)

We have to consider all (P,R,Pi)-chains

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

HBAL_TREE_IN_GA(s(s(X)), t(x, L, R)) → U1_GA(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
HBAL_TREE_IN_GA(s(s(X)), t(x, L, R)) → DISTR_IN_GGAA(s(X), X, DL, DR)
U1_GA(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_GA(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U1_GA(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → HBAL_TREE_IN_GA(DL, L)
U2_GA(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_GA(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U2_GA(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → HBAL_TREE_IN_GA(DR, R)

The TRS R consists of the following rules:

hbal_tree_in_ga(zero, nil) → hbal_tree_out_ga(zero, nil)
hbal_tree_in_ga(s(zero), t(x, nil, nil)) → hbal_tree_out_ga(s(zero), t(x, nil, nil))
hbal_tree_in_ga(s(s(X)), t(x, L, R)) → U1_ga(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
distr_in_ggaa(D1, X1, D1, D1) → distr_out_ggaa(D1, X1, D1, D1)
distr_in_ggaa(D1, D2, D1, D2) → distr_out_ggaa(D1, D2, D1, D2)
distr_in_ggaa(D1, D2, D2, D1) → distr_out_ggaa(D1, D2, D2, D1)
U1_ga(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_ga(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U2_ga(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_ga(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U3_ga(X, L, R, DL, DR, hbal_tree_out_ga(DR, R)) → hbal_tree_out_ga(s(s(X)), t(x, L, R))

The argument filtering Pi contains the following mapping:
hbal_tree_in_ga(x1, x2)  =  hbal_tree_in_ga(x1)
zero  =  zero
hbal_tree_out_ga(x1, x2)  =  hbal_tree_out_ga(x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
distr_in_ggaa(x1, x2, x3, x4)  =  distr_in_ggaa(x1, x2)
distr_out_ggaa(x1, x2, x3, x4)  =  distr_out_ggaa(x3, x4)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x2, x6)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x
HBAL_TREE_IN_GA(x1, x2)  =  HBAL_TREE_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
DISTR_IN_GGAA(x1, x2, x3, x4)  =  DISTR_IN_GGAA(x1, x2)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)
U3_GA(x1, x2, x3, x4, x5, x6)  =  U3_GA(x2, x6)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 2 less nodes.

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_GA(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_GA(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U2_GA(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → HBAL_TREE_IN_GA(DR, R)
HBAL_TREE_IN_GA(s(s(X)), t(x, L, R)) → U1_GA(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
U1_GA(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → HBAL_TREE_IN_GA(DL, L)

The TRS R consists of the following rules:

hbal_tree_in_ga(zero, nil) → hbal_tree_out_ga(zero, nil)
hbal_tree_in_ga(s(zero), t(x, nil, nil)) → hbal_tree_out_ga(s(zero), t(x, nil, nil))
hbal_tree_in_ga(s(s(X)), t(x, L, R)) → U1_ga(X, L, R, distr_in_ggaa(s(X), X, DL, DR))
distr_in_ggaa(D1, X1, D1, D1) → distr_out_ggaa(D1, X1, D1, D1)
distr_in_ggaa(D1, D2, D1, D2) → distr_out_ggaa(D1, D2, D1, D2)
distr_in_ggaa(D1, D2, D2, D1) → distr_out_ggaa(D1, D2, D2, D1)
U1_ga(X, L, R, distr_out_ggaa(s(X), X, DL, DR)) → U2_ga(X, L, R, DL, DR, hbal_tree_in_ga(DL, L))
U2_ga(X, L, R, DL, DR, hbal_tree_out_ga(DL, L)) → U3_ga(X, L, R, DL, DR, hbal_tree_in_ga(DR, R))
U3_ga(X, L, R, DL, DR, hbal_tree_out_ga(DR, R)) → hbal_tree_out_ga(s(s(X)), t(x, L, R))

The argument filtering Pi contains the following mapping:
hbal_tree_in_ga(x1, x2)  =  hbal_tree_in_ga(x1)
zero  =  zero
hbal_tree_out_ga(x1, x2)  =  hbal_tree_out_ga(x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
distr_in_ggaa(x1, x2, x3, x4)  =  distr_in_ggaa(x1, x2)
distr_out_ggaa(x1, x2, x3, x4)  =  distr_out_ggaa(x3, x4)
U2_ga(x1, x2, x3, x4, x5, x6)  =  U2_ga(x5, x6)
U3_ga(x1, x2, x3, x4, x5, x6)  =  U3_ga(x2, x6)
t(x1, x2, x3)  =  t(x1, x2, x3)
x  =  x
HBAL_TREE_IN_GA(x1, x2)  =  HBAL_TREE_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
U2_GA(x1, x2, x3, x4, x5, x6)  =  U2_GA(x5, x6)

We have to consider all (P,R,Pi)-chains

(7) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(8) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_GA(distr_out_ggaa(DL, DR)) → U2_GA(DR, hbal_tree_in_ga(DL))
U2_GA(DR, hbal_tree_out_ga(L)) → HBAL_TREE_IN_GA(DR)
HBAL_TREE_IN_GA(s(s(X))) → U1_GA(distr_in_ggaa(s(X), X))
U1_GA(distr_out_ggaa(DL, DR)) → HBAL_TREE_IN_GA(DL)

The TRS R consists of the following rules:

hbal_tree_in_ga(zero) → hbal_tree_out_ga(nil)
hbal_tree_in_ga(s(zero)) → hbal_tree_out_ga(t(x, nil, nil))
hbal_tree_in_ga(s(s(X))) → U1_ga(distr_in_ggaa(s(X), X))
distr_in_ggaa(D1, X1) → distr_out_ggaa(D1, D1)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D1, D2)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D2, D1)
U1_ga(distr_out_ggaa(DL, DR)) → U2_ga(DR, hbal_tree_in_ga(DL))
U2_ga(DR, hbal_tree_out_ga(L)) → U3_ga(L, hbal_tree_in_ga(DR))
U3_ga(L, hbal_tree_out_ga(R)) → hbal_tree_out_ga(t(x, L, R))

The set Q consists of the following terms:

hbal_tree_in_ga(x0)
distr_in_ggaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)

We have to consider all (P,Q,R)-chains.

(9) Narrowing (EQUIVALENT transformation)

By narrowing [LPAR04] the rule HBAL_TREE_IN_GA(s(s(X))) → U1_GA(distr_in_ggaa(s(X), X)) at position [0] we obtained the following new rules [LPAR04]:

HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), s(x1)))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), x1))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(x1, s(x1)))

(10) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_GA(distr_out_ggaa(DL, DR)) → U2_GA(DR, hbal_tree_in_ga(DL))
U2_GA(DR, hbal_tree_out_ga(L)) → HBAL_TREE_IN_GA(DR)
U1_GA(distr_out_ggaa(DL, DR)) → HBAL_TREE_IN_GA(DL)
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), s(x1)))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), x1))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(x1, s(x1)))

The TRS R consists of the following rules:

hbal_tree_in_ga(zero) → hbal_tree_out_ga(nil)
hbal_tree_in_ga(s(zero)) → hbal_tree_out_ga(t(x, nil, nil))
hbal_tree_in_ga(s(s(X))) → U1_ga(distr_in_ggaa(s(X), X))
distr_in_ggaa(D1, X1) → distr_out_ggaa(D1, D1)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D1, D2)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D2, D1)
U1_ga(distr_out_ggaa(DL, DR)) → U2_ga(DR, hbal_tree_in_ga(DL))
U2_ga(DR, hbal_tree_out_ga(L)) → U3_ga(L, hbal_tree_in_ga(DR))
U3_ga(L, hbal_tree_out_ga(R)) → hbal_tree_out_ga(t(x, L, R))

The set Q consists of the following terms:

hbal_tree_in_ga(x0)
distr_in_ggaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)

We have to consider all (P,Q,R)-chains.

(11) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U1_GA(distr_out_ggaa(DL, DR)) → U2_GA(DR, hbal_tree_in_ga(DL)) we obtained the following new rules [LPAR04]:

U1_GA(distr_out_ggaa(s(z0), s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(s(z0), z0)) → U2_GA(z0, hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(z0, s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(z0))

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U2_GA(DR, hbal_tree_out_ga(L)) → HBAL_TREE_IN_GA(DR)
U1_GA(distr_out_ggaa(DL, DR)) → HBAL_TREE_IN_GA(DL)
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), s(x1)))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), x1))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(x1, s(x1)))
U1_GA(distr_out_ggaa(s(z0), s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(s(z0), z0)) → U2_GA(z0, hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(z0, s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(z0))

The TRS R consists of the following rules:

hbal_tree_in_ga(zero) → hbal_tree_out_ga(nil)
hbal_tree_in_ga(s(zero)) → hbal_tree_out_ga(t(x, nil, nil))
hbal_tree_in_ga(s(s(X))) → U1_ga(distr_in_ggaa(s(X), X))
distr_in_ggaa(D1, X1) → distr_out_ggaa(D1, D1)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D1, D2)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D2, D1)
U1_ga(distr_out_ggaa(DL, DR)) → U2_ga(DR, hbal_tree_in_ga(DL))
U2_ga(DR, hbal_tree_out_ga(L)) → U3_ga(L, hbal_tree_in_ga(DR))
U3_ga(L, hbal_tree_out_ga(R)) → hbal_tree_out_ga(t(x, L, R))

The set Q consists of the following terms:

hbal_tree_in_ga(x0)
distr_in_ggaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)

We have to consider all (P,Q,R)-chains.

(13) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U1_GA(distr_out_ggaa(DL, DR)) → HBAL_TREE_IN_GA(DL) we obtained the following new rules [LPAR04]:

U1_GA(distr_out_ggaa(s(z0), s(z0))) → HBAL_TREE_IN_GA(s(z0))
U1_GA(distr_out_ggaa(s(z0), z0)) → HBAL_TREE_IN_GA(s(z0))
U1_GA(distr_out_ggaa(z0, s(z0))) → HBAL_TREE_IN_GA(z0)

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U2_GA(DR, hbal_tree_out_ga(L)) → HBAL_TREE_IN_GA(DR)
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), s(x1)))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), x1))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(x1, s(x1)))
U1_GA(distr_out_ggaa(s(z0), s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(s(z0), z0)) → U2_GA(z0, hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(z0, s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(z0))
U1_GA(distr_out_ggaa(s(z0), s(z0))) → HBAL_TREE_IN_GA(s(z0))
U1_GA(distr_out_ggaa(s(z0), z0)) → HBAL_TREE_IN_GA(s(z0))
U1_GA(distr_out_ggaa(z0, s(z0))) → HBAL_TREE_IN_GA(z0)

The TRS R consists of the following rules:

hbal_tree_in_ga(zero) → hbal_tree_out_ga(nil)
hbal_tree_in_ga(s(zero)) → hbal_tree_out_ga(t(x, nil, nil))
hbal_tree_in_ga(s(s(X))) → U1_ga(distr_in_ggaa(s(X), X))
distr_in_ggaa(D1, X1) → distr_out_ggaa(D1, D1)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D1, D2)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D2, D1)
U1_ga(distr_out_ggaa(DL, DR)) → U2_ga(DR, hbal_tree_in_ga(DL))
U2_ga(DR, hbal_tree_out_ga(L)) → U3_ga(L, hbal_tree_in_ga(DR))
U3_ga(L, hbal_tree_out_ga(R)) → hbal_tree_out_ga(t(x, L, R))

The set Q consists of the following terms:

hbal_tree_in_ga(x0)
distr_in_ggaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)

We have to consider all (P,Q,R)-chains.

(15) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(x1, s(x1)))
U1_GA(distr_out_ggaa(s(z0), s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(s(z0), z0)) → U2_GA(z0, hbal_tree_in_ga(s(z0)))
U1_GA(distr_out_ggaa(s(z0), s(z0))) → HBAL_TREE_IN_GA(s(z0))
U1_GA(distr_out_ggaa(s(z0), z0)) → HBAL_TREE_IN_GA(s(z0))
U1_GA(distr_out_ggaa(z0, s(z0))) → HBAL_TREE_IN_GA(z0)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(HBAL_TREE_IN_GA(x1)) = x1   
POL(U1_GA(x1)) = x1   
POL(U1_ga(x1)) = 1 + x1   
POL(U2_GA(x1, x2)) = x1   
POL(U2_ga(x1, x2)) = 1   
POL(U3_ga(x1, x2)) = 1   
POL(distr_in_ggaa(x1, x2)) = 0   
POL(distr_out_ggaa(x1, x2)) = 1 + x1   
POL(hbal_tree_in_ga(x1)) = 1   
POL(hbal_tree_out_ga(x1)) = 0   
POL(nil) = 0   
POL(s(x1)) = 1 + x1   
POL(t(x1, x2, x3)) = 0   
POL(x) = 0   
POL(zero) = 0   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:
none

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U2_GA(DR, hbal_tree_out_ga(L)) → HBAL_TREE_IN_GA(DR)
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), s(x1)))
HBAL_TREE_IN_GA(s(s(x1))) → U1_GA(distr_out_ggaa(s(x1), x1))
U1_GA(distr_out_ggaa(z0, s(z0))) → U2_GA(s(z0), hbal_tree_in_ga(z0))

The TRS R consists of the following rules:

hbal_tree_in_ga(zero) → hbal_tree_out_ga(nil)
hbal_tree_in_ga(s(zero)) → hbal_tree_out_ga(t(x, nil, nil))
hbal_tree_in_ga(s(s(X))) → U1_ga(distr_in_ggaa(s(X), X))
distr_in_ggaa(D1, X1) → distr_out_ggaa(D1, D1)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D1, D2)
distr_in_ggaa(D1, D2) → distr_out_ggaa(D2, D1)
U1_ga(distr_out_ggaa(DL, DR)) → U2_ga(DR, hbal_tree_in_ga(DL))
U2_ga(DR, hbal_tree_out_ga(L)) → U3_ga(L, hbal_tree_in_ga(DR))
U3_ga(L, hbal_tree_out_ga(R)) → hbal_tree_out_ga(t(x, L, R))

The set Q consists of the following terms:

hbal_tree_in_ga(x0)
distr_in_ggaa(x0, x1)
U1_ga(x0)
U2_ga(x0, x1)
U3_ga(x0, x1)

We have to consider all (P,Q,R)-chains.

(17) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 4 less nodes.

(18) TRUE